# -*- coding:utf-8 -*-
#! /usr/bin/python

import pytest
import requests
import os

@pytest.fixture
def urlBase():
    rt = os.getenv("URL_BASE")
    if rt:
        return rt
    return "http://172.16.2.26:19097"

@pytest.fixture
def user():
    rt = os.getenv("ACCOUNT")
    if rt:
        return rt
    return "root"

@pytest.fixture
def passwd():
    rt = os.getenv("PASSWD")
    if rt:
        return rt
    return "123456"

@pytest.fixture
def unauth():
    return '<html><title>403: Forbidden</title><body>403: Forbidden</body></html>'

@pytest.fixture
def cookies(urlBase,user,passwd):
    r = requests.post(url=urlBase+'/UserLogin/Login',data={'account':user,'passwd':passwd})
    return r.cookies